package com.android.qjpmc.application_module.activity;

import static cn.jzvd.Jzvd.SCREEN_NORMAL;

import com.android.qjpmc.R;
import com.android.qjpmc.bean.StationVideoListBean;
import com.android.qjpmc.databinding.ActivityVideoBinding;
import com.android.qjpmc.widget.JZMediaExo;
import com.android.qjpmc.widget.base.BaseCommonActivity;

import cn.jzvd.Jzvd;

public class VideoActivity extends BaseCommonActivity<ActivityVideoBinding> {
    @Override
    public int getLayoutId() {
        return R.layout.activity_video;
    }

    @Override
    public void initView() {
        super.initView();
        StationVideoListBean videoInfo= (StationVideoListBean) getIntent().getSerializableExtra("videoInfo");
/*        mBinding.jzVideo.setUp("http://1.24.238.208:8084/stream/device6423ae44dcc94/channel/0/hlsll/live/index.m3u8"
                , "");*/
     /*   mBinding.jzVideo.setUp("http://1.24.238.208:8084/stream/device6423ae44dcc94/channel/0/hlsll/live/index.m3u8"
                , "",SCREEN_NORMAL, JZMediaExo.class);
*/
        mBinding.jzVideo.setUp(videoInfo.url
                , videoInfo.showname,SCREEN_NORMAL, JZMediaExo.class);
        mBinding.jzVideo.startVideo();
    }
    @Override
    public void onBackPressed() {
        if (Jzvd.backPress()) {
            return;
        }
        super.onBackPressed();
    }
    @Override
    protected void onPause() {
        super.onPause();
        Jzvd.releaseAllVideos();
    }
}
